export function getIsMobile(userAgent: string): boolean {
    return /mobile|nokia|iphone|ipad|android|samsung|htc|blackberry/i.test(userAgent);
}
export enum Service {
    UNKNOWN = "unknown",
    EACP = "eacp",
    HYDRA = "hydra",
    AUTHENTICATION = "authentication",
}
export function getServiceNameFromApi(api: string = ""): Service {
    switch (true) {
        case api.includes(`/${Service.EACP}/`):
            return Service.EACP;
        case api.includes(`/${Service.HYDRA}/`):
            return Service.HYDRA;
        case api.includes(`/${Service.AUTHENTICATION}/`):
            return Service.AUTHENTICATION;
        default:
            return Service.UNKNOWN;
    }
}
export function getErrorCodeFromService(service: Service): number {
    switch (service) {
        case Service.EACP:
            return 500040001;
        case Service.HYDRA:
            return 500040002;
        case Service.AUTHENTICATION:
            return 500040003;
        default:
            return 500000000;
    }
}
